#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
int main()
{
	float arr[6][6];
	float ret = 0;
	for (int i=0;i<5;i++)
	{
		ret = 0;
		for (int j = 0; j < 5; j++)
		{
			scanf("%f",&arr[i][j]);
			ret += arr[i][j];
		}
		arr[i][5] = ret;
	}
	for (int i = 0; i < 5; i++)
	{
		for (int j = 0; j <= 5; j++)
		{
			printf("%.1f ", arr[i][j]);
		}
		printf("\n");
	}
	return 0;
}